import { _decorator, Component, Node,Quat, quat } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Rotate')
export class Rotate extends Component {

    @property
    rotateSpeed:number=100;

    private rotate:number=0;
    private rotateQuat:Quat=quat(0,0,0,0);

    start() {

    }

    update(deltaTime: number) {
        this.rotate-=deltaTime * this.rotateSpeed;
        Quat.fromEuler(this.rotateQuat, 0, 0,this.rotate);
        this.node.setRotation(this.rotateQuat);
    }
}

